package com.zpark.cloud.alibaba.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @PackageName: com.zpark.cloud.alibaba.controller
 * @ClassName: ProviderController
 * @Description:
 * @author: RZS
 * @date: 2023/6/15  9:01
 */
@RestController
@RequestMapping("/provider")
public class ProviderController {

    @Value("${spring.application.name}")
    private String serverName;
    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/test/{id}")
    public String test(@PathVariable("id") Integer id){
        return "<h1>访问服务的名字："+serverName+"，服务端口号："+serverPort+"，传入参数："+id+"</h1>";
    }
}
